package edu.sdjzu.exam.enums;

public enum GradeStatus {
    PENDING("pending", "待批改"),
    GRADING("grading", "批改中"),
    COMPLETED("completed", "已完成");

    private final String code;
    private final String display;

    GradeStatus(String code, String display) {
        this.code = code;
        this.display = display;
    }

    public String getCode() {
        return code;
    }

    public String getDisplay() {
        return display;
    }

    public static GradeStatus fromCode(String code) {
        for (GradeStatus status : values()) {
            if (status.code.equalsIgnoreCase(code)) {
                return status;
            }
        }
        throw new IllegalArgumentException("无效的成绩状态: " + code);
    }
} 